precision mediump float;
varying vec2 v_texcoord;
varying vec4 v_color;
uniform sampler2D texture;
uniform vec4 u_texRange;
uniform vec2 u_offset;
uniform float alpha;
void main() {
	vec2 newTexCoord;
	newTexCoord.x = mod(((u_offset.x + v_texcoord.x) * u_texRange.y),u_texRange.y) + u_texRange.x;
	newTexCoord.y = mod(((u_offset.y + v_texcoord.y) * u_texRange.w),u_texRange.w) + u_texRange.z;
	vec4 t_color = texture2D(texture, newTexCoord);
	gl_FragColor = t_color * v_color;
	gl_FragColor.a = gl_FragColor.a * alpha;
}